package cn.gene.timeyan.ums.webapi.ums.mapper;

import cn.gene.timeyan.pojo.ums.model.BrowsingHistory;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class UDMapper {
    @Autowired
    private UserDetailMapper userDetailMapper;
    @Autowired
    private BrowsingHistoryMapper browsingHistoryMapper;
    @Test
    public void getBrowsingList(){
        Long userId=123123435346l;
        int page=1;
        int PEAGESIZE=20;
        PageHelper.startPage(1,page*PEAGESIZE);
//        List<BrowsingHistory> list=userDetailMapper.getBrowsingList(userId);
        List<BrowsingHistory> list=browsingHistoryMapper.historyByUserId(userId);
        PageInfo<BrowsingHistory> pages=new PageInfo<>(list);
        for (BrowsingHistory browsingHistory:list) {
            System.out.println(browsingHistory);
        }
        System.out.println(pages);
    }
}
